package com.xique.door.service.impl;


import com.xique.common.core.text.Convert;
import com.xique.door.bean.domain.ElevatorReport;
import com.xique.door.bean.vo.elevator.ElevatorRunDataStatisticVO;
import com.xique.door.mapper.ElevatorReportMapper;
import com.xique.door.service.IElevatorReportService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author shd
 * @create 2021/10/12 13:49
 */
@Service
public class ElevatorReportServiceImpl implements IElevatorReportService {

    @Autowired
    private ElevatorReportMapper elevatorReportMapper;

    /**
     * 查询电梯运行统计
     *
     * @param id 电梯运行统计ID
     * @return 电梯运行统计
     */
    @Override
    public ElevatorReport selectElevatorReportById(Long id)
    {
        return elevatorReportMapper.selectElevatorReportById(id);
    }

    @Override
    public ElevatorReport selectElevatorReportByElvId(Long elvId) {
        return elevatorReportMapper.selectElevatorReportByElvId(elvId);
    }

    /**
     * 查询电梯运行统计列表
     *
     * @param elevatorReport 电梯运行统计
     * @return 电梯运行统计
     */
    @Override
    public List<ElevatorReport> selectElevatorReportList(ElevatorReport elevatorReport)
    {
        return elevatorReportMapper.selectElevatorReportList(elevatorReport);
    }

    @Override
    public List<ElevatorReport> selectElevatorReportListByParkId(Long parkId) {
        return elevatorReportMapper.selectElevatorReportListByParkId(parkId);
    }

    @Override
    public ElevatorRunDataStatisticVO selectElevatorRunDataByAddressCode(Long code) {
        return elevatorReportMapper.selectElevatorRunDataByAddressCode(code);
    }

    /**
     * 新增电梯运行统计
     *
     * @param elevatorReport 电梯运行统计
     * @return 结果
     */
    @Override
    public int insertElevatorReport(ElevatorReport elevatorReport)
    {
        return elevatorReportMapper.oneInsertElevatorReport(elevatorReport);
    }

    /**
     * 修改电梯运行统计
     *
     * @param elevatorReport 电梯运行统计
     * @return 结果
     */
    @Override
    public int updateElevatorReport(ElevatorReport elevatorReport)
    {
        return elevatorReportMapper.oneUpdateElevatorReport(elevatorReport);
    }

    /**
     * 删除电梯运行统计对象
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteElevatorReportByIds(String ids)
    {
        return elevatorReportMapper.deleteElevatorReportByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除电梯运行统计信息
     *
     * @param id 电梯运行统计ID
     * @return 结果
     */
    @Override
    public int deleteElevatorReportById(Long id)
    {
        return elevatorReportMapper.deleteElevatorReportById(id);
    }
}
